package com.heihei.demo07;

import javafx.application.Application;
import javafx.scene.Cursor;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.stage.Stage;


/**
 *
 *
 * @version 1.0
 * @since JDK1.8
 * @author duanhengfei
 * @date 2021年03月12日 10:25:06
 */
public class Start extends Application {
    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        //对象嵌套关系
        //Stage > Scene > Node
        //可以把组件放到scene上

        Button button = new Button("按钮");
        button.setPrefWidth(50);
        button.setPrefHeight(30);

        Group group = new Group();
        group.getChildren().add(button);
        Scene scene = new Scene(group);
        primaryStage.setScene(scene);

        //改变鼠标悬停样式
//        scene.setCursor(Cursor.CROSSHAIR);
//        scene.setCursor(Cursor.cursor());
        button.setCursor(Cursor.CLOSED_HAND);


        primaryStage.setTitle("Nice to meet you~");
        primaryStage.setWidth(500);
        primaryStage.setHeight(350);
        primaryStage.show();

    }
}